Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Design changes proposal
First of all, I would like to say it was a pleasure to work on a clear and fresh code.
The changes concern mainly the CLIENT part of the CLI.
The changes in CMD are only adaptions to changes in the CLIENT side.
Structural changes for the CLIENT part
Client agnosticity
There was a blurred boundary between the client concerns and the CLI concerns.
The client can be used in different software contexts so it appears to me it was important to rearrange that.
Profiles management and loading ENV variables have been removed from the CLIENT and were entrusted to the CLI part.
In result, the instanciation of the client is way more easier.
Structuring the client's lower layer
With the aim of facilitating future developments and complexity, both horizontal and vertical,
a separation has been created between the API server logic part and the client's useCases part.
A folder
/api
has been created with two files.-
profile.go
-
request.go
The first one encapsulates the profile of all the endpoints of the AppClacks's API
The second one concerns a
RequestHelper
which is the struct systematically called by theCLIENT's UseCases part. Each EndPoint has its own buildRequest method.
** Standardization of use cases **
As a result of the previous point, all the useCases have now the exact same syntax structures.
./client/healthcheck_command.go
In conclusion, the customer side should now be able to welcome new features more easily
New features for the client part
Tests Results
/v1/healthcheck
,/v1/result
and/v1/metrics
do not exist server side with Password authorization mode. (With the prefix /app/ we got "Not found, 404"/v1/organization
doesn't exist with Token authorization mode. (With the prefix /api/ we got "Not found, 404)Notes, Remarks and Questions about the global CLI
About the "github.com/appclacks/go-types" :
About the Api Client :
About the CLI :